package com.example.manager;

import com.example.enums.ShortLinkStateEnum;
import com.example.model.GroupCodeMappingDO;

import java.util.Map;

/**
 * @author yinxin
 * @version 1.0
 * @Description:
 * @date 2022/6/916:17
 */
public interface GroupCodeMappingManager {

   /**
    * 查找详情
    * @param mappingId
    * @param accountNo
    * @param groupId
    * @return
    */
   GroupCodeMappingDO findByGroupIdAndMappingId(Long mappingId,Long accountNo,Long groupId);


   /**
    * 新增
    * @param groupCodeMappingDO
    * @return
    */
   int add(GroupCodeMappingDO groupCodeMappingDO);

   /**
    * 根据短链码删除数据
    * @param groupCodeMappingDO
    * @return
    */
   int del(GroupCodeMappingDO groupCodeMappingDO);

   /**
    * 分页查找
    * @param page
    * @param size
    * @param accountNo
    * @param groupId
    * @return
    */
   Map<String,Object> pageShortLinkByGroupId(Integer page,Integer size,Long accountNo,Long groupId);


   /**
    * 跟新短链码状态
    * @param account
    * @param groupId
    * @param shortLinkCode
    * @param shortLinkStateEnum
    * @return
    */
   int updateGroupCodeMappingStatus(Long account, Long groupId, String shortLinkCode, ShortLinkStateEnum shortLinkStateEnum);

   /**
    * 根据短链码和分组id找B端短链信息
    * @param shortLinkCode
    * @param groupId
    * @param accountNo
    * @return
    */
   GroupCodeMappingDO findByCodeAndGroupId(String shortLinkCode, Long groupId, Long accountNo);

   /**
    * 跟新短链
    * @param groupCodeMappingDO
    * @return
    */
    int update(GroupCodeMappingDO groupCodeMappingDO);
}
